$lang_array = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
echo $language = $lang_array[0];